package com.itheima.controller;


import com.itheima.entity.MedicalRecord;
import com.itheima.service.MedicalRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/medical")
public class MedicalRecordController {

    @Autowired
    private MedicalRecordService medicalRecordService;



    /*查找所有*/
    @GetMapping
    public Object findAll(){
        return medicalRecordService.findAll();
    }

    /*根据id查找*/
    @GetMapping(value = "/{id}")
    public Object findById(@PathVariable(value = "id") Integer id){
        return medicalRecordService.findById(id);
    }
}
